For example, in an intra prediction mode for luminance in an AVC/H.264 (ISO/IEC 14496-10|ITU-T H.264) encoding method which is an international standard method, one prediction mode can be selected from among a plurality of prediction modes for each block (for example, refer to nonpatent reference 1). FIG. 14 is an explanatory drawing showing intra prediction modes in the case of a 4×4 pixel block size for luminance. In the case of a 4×4 pixel block size for luminance, nine intra prediction modes (a mode 0, a mode 1, . . . , and a mode 8) are defined.
In the example shown in FIG. 14, each white circle shows a pixel in a block to be encoded. Each black circle shows a pixel that is used for prediction, and that exists in an already-encoded adjacent block. The mode 2 is the one in which an average prediction is carried out in such a way that each pixel in the block to be encoded is predicted by using the average of adjacent pixels existing in the upper and left blocks. Each of the modes other than the mode 2 is the one in which a directional prediction is carried out. Particularly, the mode 0 is the one in which a vertical prediction is carried out in such a way that adjacent pixels in the upper block are repeatedly replicated to create plural rows of pixels along a vertical direction to generate a prediction image. For example, the mode 0 is selected when the block to be encoded is a vertically striped pattern. The mode 1 is the one in which a horizontal prediction is carried out in such a way that adjacent pixels in the left block are repeatedly replicated to create plural columns of pixels along a horizontal direction to generate a prediction image. Further, in each of the modes 3 to 8, interpolation pixels running in a predetermined direction (i.e., a direction shown by arrows) are generated by using the adjacent pixels in the upper block or the left block to generate a prediction image.
The block size for luminance to which an intra prediction is applied can be selected from 4×4 pixels, 8×8 pixels, and 16×16 pixels. In the case in which the block size for luminance is 8×8 pixels, nine intra prediction modes are defined, like in the case in which the block size for luminance is 4×4 pixels. In contrast with this, in the case in which the block size for luminance is 16×16 pixels, four intra prediction modes which are called plane predictions are defined in addition to an average prediction mode, a vertical prediction mode, and a horizontal prediction mode. A plane prediction mode is a mode in which pixels created by carrying out an interpolation in a diagonal direction on the adjacent pixels in the upper block and the adjacent pixels in the left block are provided as predicted values.
Although in a directional prediction mode in the case in which the block size for luminance is 4×4 pixels or 8×8 pixels, because predicted values are generated along a direction predetermined according to the mode (e.g., a direction of 45 degrees), the prediction efficiency increases and the code amount can be reduced when the direction of a boundary (edge) of an object in the block matches the direction shown by the prediction mode, the prediction efficiency decreases when the direction of an edge of an object in the block does not match the direction shown by the prediction mode. In contrast with this, because an increase in the number of selectable directional prediction modes causes an increase in the probability that the direction of an edge matches the direction shown by a prediction mode, it can be assumed that the prediction efficiency increases.